﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Having.Site.MessageQueue
{
    /// <summary>
    /// 配置MessageQueue
    /// </summary>
    public class MQConfig
    {
        /// <summary>
        /// 使用的MQ的名称
        /// </summary>
        public string MQName { set; get; }
        /// <summary>
        /// 服务器ip或者名称
        /// </summary>
        public string Host { set; get; }
        /// <summary>
        /// 启用的服务器端口
        /// </summary>
        public int Port { set; get; }
        
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { set; get; }

        /// <summary>
        /// 用户密码
        /// </summary>
        public string Password { set; get; }
        /// <summary>
        /// 信道名称
        /// </summary>
        public string Exchange { set; get; }
        /// <summary>
        /// 队列名称
        /// </summary>
        public string QueueName { set; get; }

        /// <summary>
        /// 路由标签（direct/topic 这两种模式需要用到）,多个用,分开
        /// </summary>
        public string RoutingKey { set; get; }

        /// <summary>
        /// 其他方法
        /// </summary>
        public string Others { set; get; }

        public MQConfig()
        { }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="MQName">使用的MQ的名称</param>
        /// <param name="Host">服务器ip或者名称</param>
        /// <param name="Port">启用的服务器端口</param>
        /// <param name="UserName">用户名</param>
        /// <param name="Password">用户密码</param>
        /// <param name="Exchange">信道名称</param>
        /// <param name="QueueName">队列名称</param>
        /// <param name="RoutingKey">路由标签（direct/topic 这两种模式需要用到）</param>
        /// <param name="Others">其他信息</param>
        public MQConfig(string MQName, string Host, int Port, string UserName, string Password, string Exchange="", string QueueName="", string RoutingKey="",string Others="")
        {
            this.MQName = MQName;
            this.Host = Host;
            this.Port = Port;
            this.UserName = UserName;
            this.Password = Password;
            this.Exchange = Exchange;
            this.QueueName = QueueName;
            this.RoutingKey = RoutingKey;
            this.Others = Others;
        }
    }
}
